<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script>
			var name="zhangsansansansan";
			var account=0;
			var weizhi=name.indexOf("a");
			while(weizhi!=-1){
				weizhi=name.indexOf("a",weizhi+1);
				account++;
			}alert(account); 
		</script>
	</body>
</html>
